home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / a-tasatt.adb < prev    next >
Text File  |  1996-01-30  |  3KB  |  81 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                  A D A . T A S K _ A T T R I B U T E S                   --
  6. --                                                                          --
  7. --                                 B o d y                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.3 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  Temporary version, not task aware yet!
  27.  
  28. package body Ada.Task_Attributes is
  29.  
  30.    Attribute_Value : aliased Attribute;
  31.    --  Stored value of attribute for environment task
  32.  
  33.    ---------------
  34.    -- Reference --
  35.    ---------------
  36.  
  37.    function Reference
  38.      (T    : Task_Identification.Task_Id := Task_Identification.Current_Task)
  39.       return Attribute_Handle
  40.    is
  41.    begin
  42.       return Attribute_Value'Access;
  43.    end Reference;
  44.  
  45.    ------------------
  46.    -- Reinitialize --
  47.    ------------------
  48.  
  49.    procedure Reinitialize
  50.      (T : Task_Identification.Task_Id := Task_Identification.Current_Task)
  51.    is
  52.    begin
  53.       Set_Value (Initial_Value, T);
  54.    end Reinitialize;
  55.  
  56.    ---------------
  57.    -- Set_Value --
  58.    ---------------
  59.  
  60.    procedure Set_Value
  61.      (Val : Attribute;
  62.       T   : Task_Identification.Task_Id := Task_Identification.Current_Task)
  63.    is
  64.    begin
  65.       Reference (T).all := Val;
  66.    end Set_Value;
  67.  
  68.    -----------
  69.    -- Value --
  70.    -----------
  71.  
  72.    function Value
  73.      (T    : Task_Identification.Task_Id := Task_Identification.Current_Task)
  74.       return Attribute
  75.    is
  76.    begin
  77.       return Reference (T).all;
  78.    end Value;
  79.  
  80. end Ada.Task_Attributes;
  81.